<template>
  <div class="collection">
    <div class='product-li top-li' v-for="(item,index) of lines" :key="index">
      {{item}}
    </div>
  </div>
</template>

<script>
  export default {
    name: "Detail",
    data() {
      return {
        lines: []
      }
    },
    mounted() {
      const res = this.init()
      this.lines = res.data
    },
    methods:{
      //检测是否已登录，已登录直接跳转
      async init() {
        const id = this.$route.params.id;
        const item = this.$route.params.item;
        return  await this.$Http.get({
          url:'/book/chapter',
          data: {
            id: id,
            startLine: item.startLine,
            endLine: item.endLine
          }
        })
      },
    }
  }
</script>

<style scoped>

</style>